package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.CategoriesStoreDao;
import com.vne.skyemart.model.CategoriesStore;
import com.vne.skyemart.service.CategoriesStoreService;

@Service("categoriesStoreService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class CategoriesStoreServiceImpl implements CategoriesStoreService{
	@Autowired
	private CategoriesStoreDao categoriesStoreDao;

	public CategoriesStoreDao getCategoriesStoreDao() {
		return categoriesStoreDao;
	}

	public void setCategoriesStoreDao(CategoriesStoreDao categoriesStoreDao) {
		this.categoriesStoreDao = categoriesStoreDao;
	}
	public CategoriesStoreServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addCategoriesStore(CategoriesStore categoriesstore) {
		categoriesStoreDao.save(categoriesstore);
	}

	@Override
	public List<CategoriesStore> listCategoriesStore() {
		return categoriesStoreDao.findAll();
	}
	
}
